/**********************************
 * @Author: Your Name
 * @LastEditor: Your Name
 * @LastEditTime: 2025-11-08
 * Copyright © 2025 Your Name
 **********************************/

import { request } from '@/utils/http'

// 项目分类相关API
export default {
  // 获取项目分类列表（分页）
  read: (params = {}) => {
    return request({
      url: '/pms/project-category',
      method: 'GET',
      params,
    })
  },

  // 创建项目分类
  createCategory: (data) => {
    return request({
      url: '/pms/project-category',
      method: 'POST',
      data,
    })
  },

  // 更新项目分类
  updateCategory: (data) => {
    return request({
      url: '/pms/project-category',
      method: 'PUT',
      data,
    })
  },

  // 删除项目分类
  deleteCategory: (id) => {
    return request({
      url: `/pms/project-category/${id}`,
      method: 'DELETE',
    })
  },

  // 获取项目分类树结构（全量数据）
  getProjectCategories: () => {
    return request({
      url: '/pms/project-category/list-all',
      method: 'GET',
    })
  },
}
